package com.qfedu.config;

import com.qfedu.pojo.resp.BaseResp;
import org.apache.shiro.authz.AuthorizationException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 自定义全局异常捕获类
 */
@ControllerAdvice
@ResponseBody
public class ExceptionController {
    @ExceptionHandler(AuthorizationException.class)
    public BaseResp authorizationException() {
        return new BaseResp().UnAuthor();
    }
}
